package com.heima.article.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.model.article.dtos.ArticleCommentDto;
import com.heima.model.article.dtos.ArticleHomeDto;
import com.heima.model.article.pojos.ApArticle;
import com.heima.model.article.vo.ArticleCommentVo;
import com.heima.model.wemedia.dtos.WmNewsPageReqDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface ApArticleMapper extends BaseMapper<ApArticle> {
    /**
     * @param articleHomeDto 前端数据
     * @param type           1加载更多 2加载最新
     * @return
     */
    public List<ApArticle> loadArticleList(@Param("type") short type, @Param("articleHomeDto") ArticleHomeDto articleHomeDto);

    public List<ApArticle> findArticleListByLast5days(@Param("dayParam") Date dayParam);
/*
    List<ArticleCommentVo> findNewsComments(@Param("dto") WmNewsPageReqDto dto);

    int findNewsCommentsCount(@Param("dto") WmNewsPageReqDto dto);*/


    List<ArticleCommentVo> findNewsComments(@Param("dto") ArticleCommentDto dto);

    int findNewsCommentsCount(@Param("dto")  ArticleCommentDto dto);
}
